/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.camachosanchez.gui;

import com.camachosanchez.bean.MedicionComprobacion;
import com.camachosanchez.bean.ModelosBandaNeumatico;
import com.camachosanchez.controler.jdbc.ModeloBandaNeumaticoJdbcControler;
import com.camachosanchez.controler.jpa.ModelosBandaNeumaticoJpaController;
import com.camachosanchez.gui.textfield.MaxLengthTextDocument;
import com.camachosanchez.util.Constantes;
import com.camachosanchez.util.EstadosJDialog.EstadoJDialog;
import com.camachosanchez.util.GUIUtil;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import javax.swing.JOptionPane;

/**
 *
 * @author Zully
 */
public class EditorModeloBanda extends javax.swing.JDialog {

    /**
     * Creates new form EditorModeloBanda
     */
    public EstadoJDialog Estado;
    private MaestroModelosBanda buscador;
    private int fila;
    private ModelosBandaNeumatico banda;
    MaxLengthTextDocument docAnchoLlanta = new MaxLengthTextDocument();
    MaxLengthTextDocument docAnchoSeccion = new MaxLengthTextDocument();
    MaxLengthTextDocument docDiametro = new MaxLengthTextDocument();

    public EditorModeloBanda(MaestroModelosBanda buscador, java.awt.Frame parent, boolean modal, ModelosBandaNeumatico banda, int fila) {
        super(parent, modal);
        initComponents();
        this.setLocationRelativeTo(null);
        GUIUtil.addEscapeKey(this);
        this.buscador = buscador;
        this.fila = fila;

        txtMedida.requestFocusInWindow();
        this.setResizable(false);
        docAnchoLlanta.setMaxChars(20, Constantes.DECIMALES);
        docAnchoSeccion.setMaxChars(20, Constantes.DECIMALES);
        docDiametro.setMaxChars(20, Constantes.DECIMALES);
        txtAnchoLlanta.setDocument(docAnchoLlanta);
        txtAnchoSeccion.setDocument(docAnchoSeccion);
        txtDiametroExterior.setDocument(docDiametro);

        if (banda != null) {
            this.CargarDatosBanda(banda);
            this.banda = banda;
        }
    }

    public EstadoJDialog getEstado() {
        return Estado;
    }

    public void setEstado(EstadoJDialog Estado) {
        switch (Estado) {
            case NUEVO:
                btnEliminar.setVisible(false);
//                jSeparator2.setVisible(false);
                break;
            case MODIFICAR:
                btnEliminar.setVisible(true);
//                jSeparator2.setVisible(true);
                break;
        }
        this.Estado = Estado;
    }

    private void GuardarDatos() {
        switch (this.Estado) {
            case NUEVO:
                this.RegistrarBanda(this.LeerDatosBanda());
                break;
            case MODIFICAR:
                this.ModificarBanda(this.LeerDatosBanda());
                break;
            case ELIMINAR:
                break;
            default:
                break;
        }
    }

    private void CargarDatosBanda(ModelosBandaNeumatico banda) {
        txtMedida.setText(banda.getMedida());
        if (banda.getAnchoLlantaPulgadas() != null) {
            txtAnchoLlanta.setText(banda.getAnchoLlantaPulgadas() + "");
        } else {
            txtAnchoLlanta.setText("0.0");
        }
        if (banda.getAnchoSeccionMm() != null) {
            txtAnchoSeccion.setText(banda.getAnchoSeccionMm() + "");
        } else {
            txtAnchoSeccion.setText("0.0");
        }
        if (banda.getDiametroExteriorMm() != null) {
            txtDiametroExterior.setText(banda.getDiametroExteriorMm() + "");
        } else {
            txtDiametroExterior.setText("0.0");
        }
        txpDescripcion.setText(banda.getDescripcion());
    }

    private ModelosBandaNeumatico LeerDatosBanda() {
        ModelosBandaNeumatico b = new ModelosBandaNeumatico();
        b.setMedida(txtMedida.getText().trim());
        if (!txtAnchoLlanta.getText().isEmpty()) {
            b.setAnchoLlantaPulgadas(Double.parseDouble(txtAnchoLlanta.getText()));
        }
        if (!txtAnchoSeccion.getText().isEmpty()) {
            b.setAnchoSeccionMm(Double.parseDouble(txtAnchoSeccion.getText()));
        }
        if (!txtDiametroExterior.getText().isEmpty()) {
            b.setDiametroExteriorMm(Double.parseDouble(txtDiametroExterior.getText()));
        }
        b.setDescripcion(txpDescripcion.getText());
        if (this.banda != null) {
            b.setNeumaticosList(this.banda.getNeumaticosList());
        }
        return b;
    }

    private boolean ValidarDatos() {
        if (txtMedida.getText().isEmpty()) {
            JOptionPane.showMessageDialog(this, "Se requiere una medida para el modelo de banda de neumático.", "Datos incompletos", JOptionPane.WARNING_MESSAGE);
            txtMedida.requestFocusInWindow();
            return false;
        }
        if (!txtAnchoLlanta.getText().isEmpty()) {
            try {
                double anchoLlanta = Double.parseDouble(txtAnchoLlanta.getText());
            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(this, "El valor ingresado para el ancho de llanta debe ser un número decimal.", "Datos incorrectos", JOptionPane.WARNING_MESSAGE);
                txtAnchoLlanta.requestFocusInWindow();
                return false;
            }
        }
        if (!txtAnchoSeccion.getText().isEmpty()) {
            try {
                double anchoSección = Double.parseDouble(txtAnchoSeccion.getText());
            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(this, "El valor ingresado para el ancho de sección debe ser un número decimal.", "Datos incorrectos", JOptionPane.WARNING_MESSAGE);
                txtAnchoSeccion.requestFocusInWindow();
                return false;
            }
        }
        if (!txtDiametroExterior.getText().isEmpty()) {
            try {
                double diametroExt = Double.parseDouble(txtDiametroExterior.getText());
            } catch (NumberFormatException e) {
                JOptionPane.showMessageDialog(this, "El valor ingresado para el diámetro exterior debe ser un número decimal.", "Datos incorrectos", JOptionPane.WARNING_MESSAGE);
                txtDiametroExterior.requestFocusInWindow();
                return false;
            }
        }
        return true;
    }

    private void RegistrarBanda(ModelosBandaNeumatico banda) {
        ModelosBandaNeumaticoJpaController dao_banda = new ModelosBandaNeumaticoJpaController(null);
        banda.setEstado(true);
        dao_banda.create(banda);
        JOptionPane.showMessageDialog(this, "El modelo de banda de neumático ha sido guardado correctamente.", "Operación finalizada", JOptionPane.INFORMATION_MESSAGE);
        buscador.llenarModelosBanda();
        this.dispose();
    }

    private void ModificarBanda(ModelosBandaNeumatico banda) {
        ModelosBandaNeumaticoJpaController dao_banda = new ModelosBandaNeumaticoJpaController(null);
        try {
            banda.setEstado(true);
            banda.setId(this.banda.getId());
            banda.setMedicionComprobacionList(new ArrayList<MedicionComprobacion>());
            dao_banda.edit(banda);
            JOptionPane.showMessageDialog(this, "Los datos del modelo de banda de neumático han sido actualizados correctamente.", "Operación finalizada", JOptionPane.INFORMATION_MESSAGE);
            buscador.llenarModelosBanda();
            dispose();
        } catch (Exception e) {
            e.printStackTrace();
            JOptionPane.showMessageDialog(Principal.getInstance(), e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        toolBarPrincipal = new javax.swing.JToolBar();
        pnlToolBar = new javax.swing.JPanel();
        btnGuardar = new javax.swing.JButton();
        btnEliminar = new javax.swing.JButton();
        pnlContenedor = new javax.swing.JPanel();
        lblMedida = new javax.swing.JLabel();
        txtMedida = new javax.swing.JTextField();
        lblAnchoLlanta = new javax.swing.JLabel();
        txtAnchoLlanta = new javax.swing.JTextField();
        lblAnchoSeccion = new javax.swing.JLabel();
        txtAnchoSeccion = new javax.swing.JTextField();
        lblDiametroExterior = new javax.swing.JLabel();
        txtDiametroExterior = new javax.swing.JTextField();
        tbpDescripcion = new javax.swing.JTabbedPane();
        pnlDescripcion = new javax.swing.JPanel();
        scrDescripcion = new javax.swing.JScrollPane();
        txpDescripcion = new javax.swing.JTextPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle(".:: Medida de Neumático ::.");

        toolBarPrincipal.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        toolBarPrincipal.setFloatable(false);
        toolBarPrincipal.setRollover(true);
        toolBarPrincipal.setOpaque(false);

        pnlToolBar.setBackground(new java.awt.Color(255, 255, 255));
        pnlToolBar.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        btnGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/camachosanchez/recursos/24_save.png"))); // NOI18N
        btnGuardar.setToolTipText("Guardar");
        btnGuardar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnGuardar.setFocusable(false);
        btnGuardar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btnGuardar.setMaximumSize(new java.awt.Dimension(22, 22));
        btnGuardar.setMinimumSize(new java.awt.Dimension(22, 22));
        btnGuardar.setPreferredSize(new java.awt.Dimension(22, 22));
        btnGuardar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnGuardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarActionPerformed(evt);
            }
        });
        pnlToolBar.add(btnGuardar);

        btnEliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/camachosanchez/recursos/24_delete.png"))); // NOI18N
        btnEliminar.setToolTipText("Eliminar");
        btnEliminar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnEliminar.setFocusable(false);
        btnEliminar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btnEliminar.setMaximumSize(new java.awt.Dimension(22, 22));
        btnEliminar.setMinimumSize(new java.awt.Dimension(22, 22));
        btnEliminar.setPreferredSize(new java.awt.Dimension(22, 22));
        btnEliminar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarActionPerformed(evt);
            }
        });
        pnlToolBar.add(btnEliminar);

        toolBarPrincipal.add(pnlToolBar);

        getContentPane().add(toolBarPrincipal, java.awt.BorderLayout.PAGE_START);

        lblMedida.setText("<html>Medida: <font color=\"red\">(*)</font> </html>");

        txtMedida.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtMedidaKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtMedidaKeyTyped(evt);
            }
        });

        lblAnchoLlanta.setText("Ancho Llanta (pulgadas):");

        txtAnchoLlanta.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtAnchoLlantaKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtAnchoLlantaKeyTyped(evt);
            }
        });

        lblAnchoSeccion.setText("Ancho Sección (mm.):");

        txtAnchoSeccion.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtAnchoSeccionKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtAnchoSeccionKeyTyped(evt);
            }
        });

        lblDiametroExterior.setText("Diámetro Exterior (mm.):");

        txtDiametroExterior.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtDiametroExteriorKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtDiametroExteriorKeyTyped(evt);
            }
        });

        tbpDescripcion.setBackground(new java.awt.Color(188, 211, 226));

        pnlDescripcion.setLayout(new java.awt.BorderLayout());

        scrDescripcion.setViewportView(txpDescripcion);

        pnlDescripcion.add(scrDescripcion, java.awt.BorderLayout.CENTER);

        tbpDescripcion.addTab("Descripción", pnlDescripcion);

        javax.swing.GroupLayout pnlContenedorLayout = new javax.swing.GroupLayout(pnlContenedor);
        pnlContenedor.setLayout(pnlContenedorLayout);
        pnlContenedorLayout.setHorizontalGroup(
            pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlContenedorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbpDescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
                    .addGroup(pnlContenedorLayout.createSequentialGroup()
                        .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblMedida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblAnchoLlanta)
                            .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(lblAnchoSeccion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblDiametroExterior, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtAnchoSeccion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                            .addComponent(txtAnchoLlanta, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                            .addComponent(txtMedida, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                            .addComponent(txtDiametroExterior, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))))
                .addContainerGap())
        );

        pnlContenedorLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {lblAnchoLlanta, lblAnchoSeccion, lblDiametroExterior, lblMedida});

        pnlContenedorLayout.setVerticalGroup(
            pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlContenedorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblMedida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtMedida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblAnchoLlanta)
                    .addComponent(txtAnchoLlanta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblAnchoSeccion)
                    .addComponent(txtAnchoSeccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlContenedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblDiametroExterior)
                    .addComponent(txtDiametroExterior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(14, 14, 14)
                .addComponent(tbpDescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
                .addContainerGap())
        );

        getContentPane().add(pnlContenedor, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnGuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarActionPerformed
// TODO add your handling code here:
        if (ValidarDatos()) {
            GuardarDatos();
        }
    }//GEN-LAST:event_btnGuardarActionPerformed

    private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
        // TODO add your handling code here:
        if (JOptionPane.showConfirmDialog(null, "¿Está seguro que desea eliminar este modelo de banda de neumático?", "Confirmación", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
            ModeloBandaNeumaticoJdbcControler daoJdbc = new ModeloBandaNeumaticoJdbcControler();
            byte estado = daoJdbc.eliminarModeloBanda(this.banda.getId());
            if (estado == 1) {
                JOptionPane.showMessageDialog(this, "El modelo de banda se encuentra relacionado con otros registros, no puede ser eliminado.", "Error en la eliminación", JOptionPane.ERROR_MESSAGE);
            } else {
                JOptionPane.showMessageDialog(this, "El modelo de banda se ha eliminado de forma segura.", "Operación finalizada", JOptionPane.INFORMATION_MESSAGE);
                buscador.borrarBanda(fila);
                dispose();
            }
        }
    }//GEN-LAST:event_btnEliminarActionPerformed

    private void txtMedidaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMedidaKeyPressed
// TODO add your handling code here:
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            txtAnchoLlanta.requestFocusInWindow();
        }
    }//GEN-LAST:event_txtMedidaKeyPressed

    private void txtMedidaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMedidaKeyTyped
        // TODO add your handling code here:
        String caracteres = txtMedida.getText();
        if (caracteres.length() >= 45) {
            evt.consume();
        }
    }//GEN-LAST:event_txtMedidaKeyTyped

    private void txtAnchoLlantaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtAnchoLlantaKeyPressed
// TODO add your handling code here:
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            txtAnchoSeccion.requestFocusInWindow();
        }
    }//GEN-LAST:event_txtAnchoLlantaKeyPressed

    private void txtAnchoLlantaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtAnchoLlantaKeyTyped
        // TODO add your handling code here:
        String caracteres = txtAnchoLlanta.getText();
        if (caracteres.length() >= 20) {
            evt.consume();
        }
    }//GEN-LAST:event_txtAnchoLlantaKeyTyped

    private void txtAnchoSeccionKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtAnchoSeccionKeyPressed
// TODO add your handling code here:
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            txtDiametroExterior.requestFocusInWindow();
        }
    }//GEN-LAST:event_txtAnchoSeccionKeyPressed

    private void txtAnchoSeccionKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtAnchoSeccionKeyTyped
        // TODO add your handling code here:
        String caracteres = txtAnchoSeccion.getText();
        if (caracteres.length() >= 20) {
            evt.consume();
        }
    }//GEN-LAST:event_txtAnchoSeccionKeyTyped

    private void txtDiametroExteriorKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDiametroExteriorKeyPressed
// TODO add your handling code here:
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            txpDescripcion.requestFocusInWindow();
        }
    }//GEN-LAST:event_txtDiametroExteriorKeyPressed

    private void txtDiametroExteriorKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDiametroExteriorKeyTyped
        // TODO add your handling code here:
        String caracteres = txtDiametroExterior.getText();
        if (caracteres.length() >= 20) {
            evt.consume();
        }
    }//GEN-LAST:event_txtDiametroExteriorKeyTyped
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnEliminar;
    private javax.swing.JButton btnGuardar;
    private javax.swing.JLabel lblAnchoLlanta;
    private javax.swing.JLabel lblAnchoSeccion;
    private javax.swing.JLabel lblDiametroExterior;
    private javax.swing.JLabel lblMedida;
    private javax.swing.JPanel pnlContenedor;
    private javax.swing.JPanel pnlDescripcion;
    private javax.swing.JPanel pnlToolBar;
    private javax.swing.JScrollPane scrDescripcion;
    private javax.swing.JTabbedPane tbpDescripcion;
    private javax.swing.JToolBar toolBarPrincipal;
    private javax.swing.JTextPane txpDescripcion;
    private javax.swing.JTextField txtAnchoLlanta;
    private javax.swing.JTextField txtAnchoSeccion;
    private javax.swing.JTextField txtDiametroExterior;
    private javax.swing.JTextField txtMedida;
    // End of variables declaration//GEN-END:variables
}
